#ifndef DOCTYPEDELEGATE_H
#define DOCTYPEDELEGATE_H

#include <QStyledItemDelegate>
#include <QComboBox>
//提供下拉框
class DocTypeDelegate : public QStyledItemDelegate
{
    Q_OBJECT

public:
    explicit DocTypeDelegate(QObject *parent = nullptr);
    //创建下拉编辑框
    QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
                          const QModelIndex &index) const override;
    //将模型内容设置到编辑器
    void setEditorData(QWidget *editor, const QModelIndex &index) const override;
    void setModelData(QWidget *editor, QAbstractItemModel *model,
                      const QModelIndex &index) const override;
    void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option,
                              const QModelIndex &index) const override;
};

#endif // DOCTYPEDELEGATE_H
